package com.up1234567.unistarcloud.demo.micro.web;

import com.up1234567.unistarcloud.demo.micro.remote.IMicroApi;
import lombok.CustomLog;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@CustomLog(topic = "WebController")
@RestController
public class IndexController {

    @Autowired
    private IMicroApi microApi;

    @GetMapping("hello")
    public String hello(@RequestParam("name") String name) {
        log.info("micro call {}", name);
        String deepcall = microApi.deepcall(name);
        return "hello micro =>" + deepcall;
    }

}
